import Vue from 'vue'
import Router from 'vue-router'
const Login = () => import('../pages/Login')
const InfoPage = () => import('../pages/InfoPage')
const Home = () => import('../components/Home')
const ConsumerPage = () => import("../pages/ConsumerPage")
const SingerPage = () => import("../pages/SingerPage")
const SongListPage = () => import("../pages/SongListPage")
const SongPage = () => import("../pages/SongPage")
const ListSongPage = () => import("../pages/ListSongPage")
const CollectPage = () => import("../pages/CollectPage")
const CommentPage = () => import("../pages/CommentPage")

//注册路由插件
Vue.use(Router)

export default new Router({
    //使用说明方式切换路由 hash / history
    mode: 'history',    //html5的history api
    //跟路径
    base: "/",
    routes: [
        {
            path: '/',
            name: 'login',
            component: Login
        },
        {
            path: '/Home',
            name: 'home',
            component: Home,
            children:[
                {
                    path: '/Info',
                    name: 'infoPage',
                    component: InfoPage
                },
                {
                    path: '/Consumer',
                    name: 'consumer',
                    component: ConsumerPage
                },
                {
                    path: '/Singer',
                    name: 'singer',
                    component: SingerPage
                },
                {
                    path: '/SongList',
                    name: 'songList',
                    component: SongListPage
                },
                {
                    path: '/Song',
                    name: 'song',
                    component: SongPage
                },
                {
                    path: '/ListSong',
                    name: 'listSong',
                    component: ListSongPage
                },
                {
                    path: '/Collect',
                    name: 'collect',
                    component: CollectPage
                },
                {
                    path: '/Comment',
                    name: 'comment',
                    component: CommentPage
                }
            ]
        }
    ]
});